class singleton{
    constructor(name){
        this.name = name
        this.obj = null
    }

    static getObj(name){
        console.log(this.obj)
        if(!this.obj){
            this.obj = new singleton(name)
        }
        return this.obj
    }
}
var oA = singleton.getObj('hi');
var oB = singleton.getObj('hisd');

